<?php
//Class que Gere o Envio de SMS para Novo Cliente
require_once 'C:/wSys/PHP/PEAR/SOAP/Client.php';
$wsdl_url 				= 'https://smsexpress.tmn.pt/smsexpress-webservices/SubmissionManager2?wsdl';
$WSDL     				= new SOAP_WSDL($wsdl_url);

//Config
$app_name 				= 'SMS';
$sender_owner 			= 'MoneyExpress';//Designacao do remetente

//Obtem a mensagem gravada

$le_mensagem 			= $GLOBALS['MYT']->db_array("SELECT csm_Text FROM systemoffice.contact_savedmsg");
$sms_send_text			= $le_mensagem[1]["csm_Text"];

//Obtem o numero de telemovel
$sms_send_mobile_number	= $_POST['CliTelefono2'];
//Script de envio	
$client = $WSDL->getProxy(); 

//Verifica/Activa os certificados SSL
$client->setOpt('curl', CURLOPT_VERBOSE, 1);
$client->setOpt('curl', CURLOPT_SSL_VERIFYPEER, 0);
$client->setOpt('curl', CURLOPT_SSL_VERIFYHOST, 0);
			
	$params1 = array ('application' => $app_name,
			'username' => '12132021',
			'password' => 'rXrkMxFE');
			
	$params2 = array ('message' => $sms_send_text,
			'recipients' => $sms_send_mobile_number,
			'sender' => 'MONEYEXPRES',
			'validity' => 24);
//Envia a mensagem
$client->sendSmsSubmission($params1,$params2);